package execute;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.platform.main.CodeMeachine;
import com.platform.tool.util.ConvertUtil;

public class RunEntrance {

	public static void main(String[] args) throws SQLException {
		String tableName = "litemall_cashes";



//		CodeMeachine.setGeneratePath("/users/macbook/workspace/code/");
		CodeMeachine.setGeneratePath("d://code/");
		CodeMeachine.setPackageName("com.coachtam.tqt");
		CodeMeachine.setModule("商场管理");
		CodeMeachine.setRootPath("cashes");
		CodeMeachine.setEntityRemark("提现管理");


		String fileNamePrefix ="AdminCashes";

		List<String> exclusiveFiled =new ArrayList<>();
		//排除字段
		exclusiveFiled.add("id");
		exclusiveFiled.add("updateTime");
		exclusiveFiled.add("addTime");
		exclusiveFiled.add("deleted");


//		CodeMeachine.generateFileWithDb("Entity.ftl", tableName, ".java", Collections.emptyList());
//		CodeMeachine.generateFileWithDb("Repository.ftl", tableName, "Repository.java", Collections.emptyList());
//		CodeMeachine.generateFileWithDb("mapper.hbm.ftl", tableName, ".hbm.xml",null);
//		CodeMeachine.generateFileWithDb("LitemallService.ftl", tableName, "Service.java", Collections.emptyList());
		CodeMeachine.generateFileWithDb("LitemallService.ftl", tableName, fileNamePrefix,"Service.java", Collections.emptyList());
		CodeMeachine.generateFileWithDb("LitemallController.ftl", tableName, fileNamePrefix,"Controller.java", Collections.emptyList());
		CodeMeachine.generateFileWithDb("LitemallVue.ftl", tableName, CodeMeachine.rootPath,".vue", exclusiveFiled);
		CodeMeachine.generateFileWithDb("api.ftl", tableName, CodeMeachine.rootPath,".js", exclusiveFiled);

		System.out.println("Generate success.");
	}

}
